using System.Data;
using ScrumTable.DL.Data.Schema;

namespace ScrumTable.DL.Data.Excel.Services.Excel
{
    /// <summary>
    /// Defines a class to map a schema to a excel sheet.
    /// </summary>
    internal class SheetSchemaMapping : SheetMapping
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Gets the associated schema instance.
        /// </summary>
        internal SchemaBase Schema { get; private set; }

        #endregion

        #region Constructors / Destructor

        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Creates a new SheetSchemaMapping instance.
        /// </summary>
        /// <param name="workbookData">Specifies the underlying data.</param>
        /// <param name="schema">Specifies the schema which maps the data from the a ScrumTable field to the Excel data.</param>
        /// <param name="idIncrementSeed">Specifies the start seed for the id increment algo.</param>
        internal SheetSchemaMapping(DataSet workbookData, SchemaBase schema, int idIncrementSeed)
            : base(workbookData, schema.SchemaMappedName, idIncrementSeed)
        {
            Schema = schema;
        }

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }


    /// <summary>
    /// Defines a class to map a schema to a excel sheet.
    /// </summary>
    internal class SheetSchemaMapping<T> : SheetSchemaMapping
        where T : SchemaBase
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Gets the associated schema instance.
        /// </summary>
        internal T SchemaTyped { get; private set; }

        #endregion

        #region Constructors / Destructor

        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Creates a new SheetSchemaMapping instance.
        /// </summary>
        /// <param name="workbookData">Specifies the underlying data.</param>
        /// <param name="schema">Specifies the schema which maps the data from the a ScrumTable field to the Excel data.</param>
        /// <param name="idIncrementSeed">Specifies the start seed for the id increment algo.</param>
        internal SheetSchemaMapping(DataSet workbookData, T schema, int idIncrementSeed)
            : base(workbookData, schema, idIncrementSeed)
        {
            SchemaTyped = schema;
        }

        #endregion
    }
}